//
//  XMLParse.h
//  Meal Wheel
//
//  Created by Justin Dell on 7/4/08.
//  Copyright 2008 . All rights reserved.
//

/* A wrapper class for the main NSXMLParser that interacts with the xml file */

#import <Cocoa/Cocoa.h>
#import "FoodTree.h"


@interface XMLParse : NSObject {
    NSXMLParser *addressParser;
    FoodTree *foodTree;
    int numFoods;
}

// File parser function given a file path
-(void)parseXML:(NSString *)file;

// returns the Food tree structure
-(FoodTree *)getFoodTree;

// called while parsing a file for every element in the xml
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict;

// called when inside text of an xml is parsed
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string;

// writes the food tree to the file indicated by path
-(void)writeXML:(string)path;

@end
